
	function createDateSelectBox(name, num,num2) {
		// 파라미터 설명 : name - 셀렌트 박스 이름, num - 현재년도에서 플러스,  num2 - 마이너스 년도

		var dt = new Date();
		var c_id = document.getElementById(name + "_id");
		var inHtml = "";
		var currentYear = dt.getFullYear();
		var currentMonth = dt.getMonth() + 1;
		var currentDay = dt.getDate();
		var dt2 = new Date(currentYear, currentMonth, "");
		var intNum = parseInt(num);
		var intNum2 = parseInt(num2);
		var optMonth = "";
		var optDay = "";
		var lastDay = dt2.getDate();
		//var selected = "";

		inHtml += " <select name='year' id='" + name + "_year' onchange='onchageDate(\"" + name + "\")' class='select'> ";

		for(var i = currentYear - intNum; i < 1988; i++) {
			inHtml += "<option value='" + i + "' >" + i + "</opton>";
		}
		inHtml += " <option value='1989' selected='selected'>1989</option>";
		for(var i = 1989; i <= currentYear + intNum2; i++) {
			inHtml += "<option value='" + i + "' >" + i + "</opton>";
		}
		inHtml += " </select> 년&nbsp;&nbsp;&nbsp;";
		inHtml += " <select name='month' id='" + name + "_month' onchange='onchageDate(\"" + name + "\")' class='select'> ";

		for(var i = 1; i <= 12; i++) {
			
			optMonth = i;
			
			inHtml += " <option value='" + optMonth + "' >" + optMonth + "</option>";
		}
		inHtml += " </select> 월&nbsp;&nbsp;&nbsp;";
		inHtml += " <select name='day' id='" + name + "_day' class='select'> ";

		for(var i = 1; i <= lastDay; i++) {
			
			optDay = i;
			
			inHtml += " <option value='" + optDay + "' >" + optDay + "</option>";
		}
		inHtml += " </select> 일";

		c_id.innerHTML = inHtml;
	}

	function onchageDate(name) {
		var optDay = "";
		// year, month, day SelectBox찾기
		selectYear = document.getElementById(name + "_year");
		selectMonth = document.getElementById(name + "_month");
		selectDay = document.getElementById(name + "_day");

		// 현재 년도와 월 구하기
		year = selectYear.options[selectYear.selectedIndex].value;
		month = selectMonth.options[selectMonth.selectedIndex].value;
		tmpDate = new Date(year, month, 0);
		selectedIndex = selectDay.selectedIndex;

		for( i = selectDay.length - 1; i >= 0; i--) {
			selectDay.options[i] = null;
		}

		selectDay.options[0] = new Option('1', '');

		for( i = 1; i <= tmpDate.getDate(); i++) {
			
			optDay = i;
			
			selectDay.options[i-1] = new Option(optDay, optDay);
		}

		if(selectedIndex <= tmpDate.getDate()) {
			selectDay.options[selectedIndex].selected = true;
		} else {
			selectDay.options[tmpDate.getDate() - 1].selected = true;
		}
	}
